<!DOCTYPE html>
<html lang="zh-CN">
<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Java入门指南 - 技术小馆</title>
    <link href="https://cdn.staticfile.org/font-awesome/6.4.0/css/all.min.css" rel="stylesheet">
    <link href="https://cdn.staticfile.org/tailwindcss/2.2.19/tailwind.min.css" rel="stylesheet">
    <link href="https://fonts.googleapis.com/css2?family=Noto+Serif+SC:wght@400;500;600;700&family=Noto+Sans+SC:wght@300;400;500;700&display=swap" rel="stylesheet">
    <script src="https://cdn.jsdelivr.net/npm/mermaid@latest/dist/mermaid.min.js"></script>
    <style>
        body {
            font-family: 'Noto Sans SC', Tahoma, Arial, Roboto, "Droid Sans", "Helvetica Neue", "Droid Sans Fallback", "Heiti SC", "Hiragino Sans GB", Simsun, sans-serif;
            color: #333;
            line-height: 1.6;
        }
        h1, h2, h3, h4 {
            font-family: 'Noto Serif SC', serif;
            font-weight: 700;
        }
        .hero-gradient {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        .card-hover {
            transition: all 0.3s ease;
        }
        .card-hover:hover {
            transform: translateY(-5px);
            box-shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.1), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
        }
        .step-icon {
            width: 40px;
            height: 40px;
            background-color: #4f46e5;
            color: white;
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin-right: 15px;
            flex-shrink: 0;
        }
        .code-block {
            background-color: #2d3748;
            color: #f7fafc;
            border-radius: 0.375rem;
            padding: 1rem;
            position: relative;
        }
        .code-block pre {
            margin: 0;
            overflow-x: auto;
        }
        .code-block .copy-btn {
            position: absolute;
            top: 0.5rem;
            right: 0.5rem;
            background-color: rgba(255, 255, 255, 0.1);
            border: none;
            color: #f7fafc;
            padding: 0.25rem 0.5rem;
            border-radius: 0.25rem;
            cursor: pointer;
            transition: all 0.2s;
        }
        .code-block .copy-btn:hover {
            background-color: rgba(255, 255, 255, 0.2);
        }
        .first-letter {
            font-size: 3.5rem;
            line-height: 1;
            float: left;
            margin-right: 0.5rem;
            margin-bottom: -0.5rem;
            color: #4f46e5;
            font-weight: bold;
        }
        .diagram-container {
            background-color: #f8fafc;
            border-radius: 0.5rem;
            padding: 1.5rem;
            margin: 2rem 0;
        }
        .concept-card {
            border-left: 4px solid #4f46e5;
            transition: all 0.3s ease;
        }
        .concept-card:hover {
            background-color: #f8fafc;
        }
    </style>
</head>
<body class="bg-gray-50">
    <!-- Hero Section -->
    <section class="hero-gradient text-white py-20">
        <div class="container mx-auto px-6 lg:px-16">
            <div class="flex flex-col lg:flex-row items-center">
                <div class="lg:w-1/2 mb-10 lg:mb-0">
                    <h1 class="text-4xl md:text-5xl font-bold mb-6 leading-tight">Java编程入门指南</h1>
                    <p class="text-xl mb-8 opacity-90">从零开始学习Java开发，掌握核心概念与实战技巧</p>
                    <div class="flex flex-wrap gap-4">
                        <a href="#getting-started" class="bg-white text-indigo-700 px-6 py-3 rounded-lg font-semibold hover:bg-gray-100 transition duration-300">
                            <i class="fas fa-rocket mr-2"></i>开始学习
                        </a>
                        <a href="#exercise" class="border border-white px-6 py-3 rounded-lg font-semibold hover:bg-white hover:text-indigo-700 transition duration-300">
                            <i class="fas fa-tasks mr-2"></i>作业练习
                        </a>
                    </div>
                </div>
                <div class="lg:w-1/2 flex justify-center">
                    <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1707374753277-2c116a5b-2804-42a5-b227-53f1d0b606c1.png" alt="Java编程" class="rounded-lg shadow-xl w-full max-w-md">
                </div>
            </div>
        </div>
    </section>

    <!-- Main Content -->
    <div class="container mx-auto px-6 lg:px-16 py-12">
        <!-- Getting Started -->
        <section id="getting-started" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 text-indigo-700 p-3 rounded-full mr-4">
                    <i class="fas fa-tools text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold">开发工具安装</h2>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <div class="p-6">
                    <h3 class="text-2xl font-semibold mb-4 text-indigo-700">Notepad++ 简介</h3>
                    <p class="mb-6 text-gray-700">Notepad++（简称NPP）是一款免费、开源的文本编辑器，它支持多种编程语言，具有语法高亮、自动完成、括号匹配、分屏编辑等功能。Notepad++是许多开发人员和程序员首选的文本编辑工具，因为它轻巧、功能强大、易于使用。</p>
                    
                    <div class="grid md:grid-cols-2 gap-8">
                        <div>
                            <h4 class="text-xl font-semibold mb-4 text-gray-800 flex items-center">
                                <i class="fas fa-download mr-2 text-indigo-600"></i>安装步骤
                            </h4>
                            <ol class="space-y-4">
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">1</span>
                                    </div>
                                    <div>
                                        <strong>下载 Notepad++</strong>
                                        <p class="text-gray-600">前往 Notepad++ 的官方网站 <a href="https://notepad-plus-plus.org/downloads/" class="text-indigo-600 hover:underline" target="_blank">https://notepad-plus-plus.org/downloads/</a></p>
                                    </div>
                                </li>
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">2</span>
                                    </div>
                                    <div>
                                        <strong>选择下载版本</strong>
                                        <p class="text-gray-600">看到两个版本：32位和64位。通常情况下，选择64位版本，因为它能够更好地利用现代计算机的性能。</p>
                                    </div>
                                </li>
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">3</span>
                                    </div>
                                    <div>
                                        <strong>运行安装程序</strong>
                                        <p class="text-gray-600">找到下载的安装程序文件（通常是一个`.exe`文件），双击运行它并按照向导完成安装。</p>
                                    </div>
                                </li>
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">4</span>
                                    </div>
                                    <div>
                                        <strong>启动 Notepad++</strong>
                                        <p class="text-gray-600">可以在开始菜单或桌面上找到 Notepad++ 图标，双击它以启动该程序。</p>
                                    </div>
                                </li>
                            </ol>
                        </div>
                        <div class="flex items-center justify-center">
                            <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1693641636051-7381bf0f-ad4c-4d30-a88b-9f351273e58d.png" alt="Notepad++界面" class="rounded-lg shadow">
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- First Java Program -->
        <section class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 text-indigo-700 p-3 rounded-full mr-4">
                    <i class="fas fa-code text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold">第一个Java程序</h2>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <div class="p-6">
                    <h3 class="text-2xl font-semibold mb-4 text-indigo-700">Hello World程序</h3>
                    <p class="mb-6 text-gray-700">当Java环境已经安装好的前提下，编写一个输出 "Hello, World!" 的Java程序非常简单。以下是步骤：</p>
                    
                    <div class="grid md:grid-cols-2 gap-8">
                        <div>
                            <div class="mb-6">
                                <h4 class="text-xl font-semibold mb-4 text-gray-800 flex items-center">
                                    <i class="fas fa-file-code mr-2 text-indigo-600"></i>编写Java代码
                                </h4>
                                <div class="code-block">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre><code>public class HelloWorld {
    public static void main(String[] args) {
        System.out.println("Hello, World!");
    }
}</code></pre>
                                </div>
                            </div>
                            
                            <div>
                                <h4 class="text-xl font-semibold mb-4 text-gray-800 flex items-center">
                                    <i class="fas fa-terminal mr-2 text-indigo-600"></i>编译与运行
                                </h4>
                                <div class="code-block mb-4">
                                    <button class="copy-btn" onclick="copyCode(this)">
                                        <i class="fas fa-copy"></i>
                                    </button>
                                    <pre><code>javac HelloWorld.java
java HelloWorld</code></pre>
                                </div>
                                <p class="text-gray-600">如果一切正常，你将在屏幕上看到输出 "Hello, World!"</p>
                            </div>
                        </div>
                        <div>
                            <div class="bg-gray-50 p-6 rounded-lg">
                                <h4 class="text-xl font-semibold mb-4 text-gray-800">代码解析</h4>
                                <ul class="space-y-4">
                                    <li class="flex items-start">
                                        <div class="bg-indigo-100 text-indigo-700 p-1 rounded-full mr-3">
                                            <i class="fas fa-check text-sm"></i>
                                        </div>
                                        <div>
                                            <strong>public class HelloWorld</strong>
                                            <p class="text-gray-600">定义了一个名为"HelloWorld"的公共类</p>
                                        </div>
                                    </li>
                                    <li class="flex items-start">
                                        <div class="bg-indigo-100 text-indigo-700 p-1 rounded-full mr-3">
                                            <i class="fas fa-check text-sm"></i>
                                        </div>
                                        <div>
                                            <strong>public static void main(String[] args)</strong>
                                            <p class="text-gray-600">程序的入口方法，JVM从这里开始执行</p>
                                        </div>
                                    </li>
                                    <li class="flex items-start">
                                        <div class="bg-indigo-100 text-indigo-700 p-1 rounded-full mr-3">
                                            <i class="fas fa-check text-sm"></i>
                                        </div>
                                        <div>
                                            <strong>System.out.println()</strong>
                                            <p class="text-gray-600">向控制台输出文本</p>
                                        </div>
                                    </li>
                                </ul>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Java Execution Flow -->
        <section class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 text-indigo-700 p-3 rounded-full mr-4">
                    <i class="fas fa-project-diagram text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold">Java程序的运行原理</h2>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <div class="p-6">
                    <div class="mb-6">
                        <p class="mb-6 text-gray-700">当我们运行一个Java程序时，它会经历以下主要的执行流程：</p>
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1707374930560-156075b3-746d-438b-9127-bf7634a0e62d.png" alt="Java执行流程" class="w-full rounded-lg shadow">
                    </div>
                    
                    <div class="grid md:grid-cols-2 gap-8">
                        <div>
                            <h4 class="text-xl font-semibold mb-4 text-gray-800">执行流程详解</h4>
                            <ol class="space-y-4">
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">1</span>
                                    </div>
                                    <div>
                                        <strong>编写Java源代码</strong>
                                        <p class="text-gray-600">程序员编写Java源代码，这是程序的原始文本形式。</p>
                                    </div>
                                </li>
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">2</span>
                                    </div>
                                    <div>
                                        <strong>编译Java程序</strong>
                                        <p class="text-gray-600">使用Java编译器(javac)将源代码翻译成字节码。</p>
                                    </div>
                                </li>
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">3</span>
                                    </div>
                                    <div>
                                        <strong>运行Java程序</strong>
                                        <p class="text-gray-600">使用Java虚拟机(JVM)来运行编译后的字节码文件。</p>
                                    </div>
                                </li>
                                <li class="flex items-start">
                                    <div class="step-icon">
                                        <span class="font-bold">4</span>
                                    </div>
                                    <div>
                                        <strong>程序执行</strong>
                                        <p class="text-gray-600">JVM加载字节码文件，执行其中的main方法。</p>
                                    </div>
                                </li>
                            </ol>
                        </div>
                        <div>
                            <div class="bg-gray-50 p-6 rounded-lg h-full">
                                <h4 class="text-xl font-semibold mb-4 text-gray-800">关键概念</h4>
                                <p class="mb-4 text-gray-600">Java程序的执行流程涉及编写源代码、编译成字节码、运行在Java虚拟机上以及输出结果。Java虚拟机充当了一个中间层，使得Java程序可以在不同的操作系统和硬件平台上运行，实现了<strong>跨平台</strong>性。</p>
                                <div class="diagram-container">
                                    <div class="mermaid">
                                        graph TD
                                            A[源代码.java] --> B[编译器javac]
                                            B --> C[字节码.class]
                                            C --> D[JVM]
                                            D --> E[机器码]
                                            E --> F[执行]
                                    </div>
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Java Cross-Platform -->
        <section class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 text-indigo-700 p-3 rounded-full mr-4">
                    <i class="fas fa-laptop-code text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold">Java跨平台特性</h2>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden mb-8 card-hover">
                <div class="p-6">
                    <div class="mb-6">
                        <p class="mb-6 text-gray-700">Java的"跨平台"（Platform Independence）是指Java程序可以在不同的操作系统和硬件平台上运行，而不需要对源代码进行修改。这是Java语言的一个重要特性，也被称为"Write Once, Run Anywhere"（一次编写，到处运行）。</p>
                        <img src="https://cdn.nlark.com/yuque/0/2024/png/21449790/1707375006652-8573b264-0da0-4fb1-a5e1-c657e049a6fd.png" alt="Java跨平台" class="w-full rounded-lg shadow">
                    </div>
                    
                    <div class="grid md:grid-cols-2 gap-8">
                        <div>
                            <h4 class="text-xl font-semibold mb-4 text-gray-800">跨平台实现原理</h4>
                            <div class="space-y-4">
                                <div class="concept-card p-4 bg-gray-50 rounded-r-lg">
                                    <h5 class="font-semibold text-lg text-indigo-700 mb-2">中间字节码</h5>
                                    <p class="text-gray-600">Java编译器将源代码编译成字节码，这是一种与特定硬件和操作系统无关的中间表示。</p>
                                </div>
                                <div class="concept-card p-4 bg-gray-50 rounded-r-lg">
                                    <h5 class="font-semibold text-lg text-indigo-700 mb-2">Java虚拟机(JVM)</h5>
                                    <p class="text-gray-600">JVM是Java跨平台的关键。每个支持Java的操作系统都有自己的JVM实现，负责将字节码翻译成特定平台的机器代码。</p>
                                </div>
                                <div class="concept-card p-4 bg-gray-50 rounded-r-lg">
                                    <h5 class="font-semibold text-lg text-indigo-700 mb-2">平台无关的API</h5>
                                    <p class="text-gray-600">Java标准库中的API是与平台无关的。这意味着Java程序可以使用标准库提供的功能，而无需担心底层操作系统的细节。</p>
                                </div>
                            </div>
                        </div>
                        <div>
                            <div class="bg-indigo-50 p-6 rounded-lg h-full">
                                <h4 class="text-xl font-semibold mb-4 text-indigo-800">跨平台优势</h4>
                                <ul class="space-y-4">
                                    <li class="flex items-start">
                                        <div class="bg-indigo-200 text-indigo-700 p-1 rounded-full mr-3">
                                            <i class="fas fa-check text-sm"></i>
                                        </div>
                                        <div>
                                            <strong>一次编写，多处运行</strong>
                                            <p class="text-gray-700">Java程序可以在任何支持Java的操作系统上运行，无需进行修改。</p>
                                        </div>
                                    </li>
                                    <li class="flex items-start">
                                        <div class="bg-indigo-200 text-indigo-700 p-1 rounded-full mr-3">
                                            <i class="fas fa-check text-sm"></i>
                                        </div>
                                        <div>
                                            <strong>提高开发效率</strong>
                                            <p class="text-gray-700">开发人员可以专注于程序的逻辑和功能，不必为不同平台编写不同版本的代码。</p>
                                        </div>
                                    </li>
                                    <li class="flex items-start">
                                        <div class="bg-indigo-200 text-indigo-700 p-1 rounded-full mr-3">
                                            <i class="fas fa-check text-sm"></i>
                                        </div>
                                        <div>
                                            <strong>广泛适用性</strong>
                                            <p class="text-gray-700">Java在各个领域广泛应用，包括移动应用、Web应用、嵌入式系统等。</p>
                                        </div>
                                    </li>
                                </ul>
                                <div class="mt-6">
                                    <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1693642005979-b03eebc4-311a-4ec8-96ba-5722e39c310e.png" alt="Java跨平台应用" class="w-full rounded-lg shadow">
                                </div>
                            </div>
                        </div>
                    </div>
                </div>
            </div>
        </section>

        <!-- Java Key Concepts -->
        <section class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 text-indigo-700 p-3 rounded-full mr-4">
                    <i class="fas fa-cubes text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold">Java核心概念</h2>
            </div>
            
            <div class="grid md:grid-cols-3 gap-6">
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 text-indigo-700 p-2 rounded-lg mr-4">
                                <i class="fas fa-microchip text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold">JDK</h3>
                        </div>
                        <p class="text-gray-600 mb-4">Java Development Kit（开发工具包）</p>
                        <p class="text-gray-700">包含JRE + 类库 + 开发工具包（编译器+调试工具）。</p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 text-indigo-700 p-2 rounded-lg mr-4">
                                <i class="fas fa-play-circle text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold">JRE</h3>
                        </div>
                        <p class="text-gray-600 mb-4">Java Runtime Environment（运行环境）</p>
                        <p class="text-gray-700">包含JVM和解释器，完整的Java运行环境。</p>
                    </div>
                </div>
                
                <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                    <div class="p-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 text-indigo-700 p-2 rounded-lg mr-4">
                                <i class="fas fa-server text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold">JVM</h3>
                        </div>
                        <p class="text-gray-600 mb-4">Java Virtual Machine（虚拟机）</p>
                        <p class="text-gray-700">使用软件在不同操作系统中，模拟相同的环境。</p>
                    </div>
                </div>
            </div>
            
            <div class="mt-8">
                <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1693642344353-cb58aee8-8250-4cb6-9698-44e23674c3c2.png" alt="JDK JRE JVM关系" class="w-full rounded-lg shadow">
            </div>
        </section>

        <!-- Exercise -->
        <section id="exercise" class="mb-20">
            <div class="flex items-center mb-8">
                <div class="bg-indigo-100 text-indigo-700 p-3 rounded-full mr-4">
                    <i class="fas fa-tasks text-2xl"></i>
                </div>
                <h2 class="text-3xl font-bold">作业练习</h2>
            </div>
            
            <div class="bg-white rounded-xl shadow-md overflow-hidden card-hover">
                <div class="p-6">
                    <div class="mb-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 text-indigo-700 p-2 rounded-lg mr-4">
                                <i class="fas fa-laptop-code text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold">实践任务</h3>
                        </div>
                        <p class="text-gray-700 mb-2">要求采用notepad++的方式，自己手动编写HelloWorld程序，并且通过命令行窗口进行编译和运行，要求输出个人的自我介绍信息（姓名，年龄，擅长技术，爱好等等）</p>
                        <img src="https://cdn.nlark.com/yuque/0/2023/png/21449790/1692614469027-5cd8f756-f23b-43f7-8bef-f468ba0f7ac2.png" alt="作业示例" class="w-full max-w-md rounded-lg shadow mt-4">
                    </div>
                    
                    <div class="mb-6">
                        <div class="flex items-center mb-4">
                            <div class="bg-indigo-100 text-indigo-700 p-2 rounded-lg mr-4">
                                <i class="fas fa-book text-xl"></i>
                            </div>
                            <h3 class="text-xl font-semibold">理论任务</h3>
                        </div>
                        <ol class="list-decimal list-inside space-y-2 text-gray-700">
                            <li>能够通过画图及文字来解释java的跨平台特性</li>
                            <li>能够通过画图及文字来解释JDK,JRE,JVM的相关概念</li>
                            <li>固定作业：当天的总结文档，给自己用的</li>
                        </ol>
                    </div>
                    
                    <div class="bg-indigo-50 p-6 rounded-lg">
                        <h4 class="text-xl font-semibold mb-4 text-indigo-800">提交要求</h4>
                        <ul class="space-y-3 text-gray-700">
                            <li class="flex items-start">
                                <div class="bg-indigo-200 text-indigo-700 p-1 rounded-full mr-3 mt-1 flex-shrink-0">
                                    <i class="fas fa-check text-xs"></i>
                                </div>
                                <div>所有代码和文档需要保存为适当的格式（.java, .md等）</div>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-indigo-200 text-indigo-700 p-1 rounded-full mr-3 mt-1 flex-shrink-0">
                                    <i class="fas fa-check text-xs"></i>
                                </div>
                                <div>代码需要良好的格式和适当的注释</div>
                            </li>
                            <li class="flex items-start">
                                <div class="bg-indigo-200 text-indigo-700 p-1 rounded-full mr-3 mt-1 flex-shrink-0">
                                    <i class="fas fa-check text-xs"></i>
                                </div>
                                <div>文档需要清晰有条理，包含必要的截图和解释</div>
                            </li>
                        </ul>
                    </div>
                </div>
            </div>
        </section>
    </div>

    <!-- Footer -->
    <footer class="bg-gray-900 text-gray-300 py-12">
        <div class="container mx-auto px-6 lg:px-16">
            <div class="flex flex-col md:flex-row justify-between items-center">
                <div class="mb-6 md:mb-0">
                    <h3 class="text-2xl font-bold text-white mb-2">技术小馆</h3>
                    <p class="text-gray-400">专业的Java学习资源平台</p>
                </div>
                <div>
                    <a href="http://www.yuque.com/jtostring" class="text-indigo-400 hover:text-white transition duration-300">
                        <i class="fas fa-globe mr-2"></i>技术小馆地址
                    </a>
                </div>
            </div>
            <div class="border-t border-gray-800 mt-8 pt-8 text-center text-gray-500 text-sm">
                &copy; 2023 技术小馆. 版权所有.
            </div>
        </div>
    </footer>

    <script>
        // Initialize Mermaid
        mermaid.initialize({
            startOnLoad: true,
            theme: 'default',
            flowchart: {
                useMaxWidth: true,
                htmlLabels: true,
                curve: 'basis'
            }
        });
        
        // Copy code function
        function copyCode(button) {
            const codeBlock = button.parentElement;
            const code = codeBlock.querySelector('code').innerText;
            navigator.clipboard.writeText(code).then(() => {
                button.innerHTML = '<i class="fas fa-check"></i>';
                setTimeout(() => {
                    button.innerHTML = '<i class="fas fa-copy"></i>';
                }, 2000);
            });
        }
    </script>
</body>
</html>